# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        Young  
# Name:         demo7_05
# Description:  函数参数
# Author:       asus
# Date:         2019/3/11
#-------------------------------------------------------------------------------


data = {}
data["d"] = {}
data["names"] = []
data["products"] = []
print("请输入字典数据，key和value之间用逗号隔开")
dictStr = input(":")
#将以逗号分隔字符串转为列表
list = dictStr.split(",")
keys = []
values = []
#将列表拆分成keys哈values的两个列表
for i in range(len(list)):
    if i % 2 == 0:
        keys.append(list[i])
    else:
        values.append(list[i])
data["d"].update(dict(zip(keys,values)))

print("请输入姓名，多个姓名用逗号隔开")
nameStr = input(":")
#将以逗号隔开的字符串转换为列表
names = nameStr.split(",")
data["names"].extend(names)
print("请输入产品，多个产品之间用逗号隔开")
productStr = input(":")
products = productStr.split(",")
data["products"].extend(products)

#输出字典data中的数据，每一个key和对应的值是一行
for key in data.keys():
    print(key,":",data[key])